﻿<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="Encrypt_connection_string.aspx.cs" Inherits="Admin_Encrypt_connection_string" Title="Encrypt Connection String" ValidateRequest="false" %>
<%@ Register src="UserControls/adminUserNavLinks.ascx" tagname="adminUserNavLinks" tagprefix="uc1" %>


<%-- content placeholder for head section --%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<%-- content placeholder for body title --%>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBodyTitle" Runat="Server">
    Connection String Security
</asp:Content>

<%-- content placeholder for user navigation --%>
<asp:Content ID="Content3" ContentPlaceHolderID="cphUserNavigation" Runat="Server">

    <%-- user navigation include --%>
    <uc1:adminUserNavLinks ID="adminUserNavLinks1" runat="server" />
    
</asp:Content>

<%-- content placeholder for content body --%>
<asp:Content ID="Content4" ContentPlaceHolderID="cphContentBody" Runat="Server">

    <div class="adminHelp">
    Warning!: Use this tool after your files have been uploaded to your hosting provider. 
    You can however test it locally. Use this page to encrypt or decrypt the connection string 
    present in your web.config file. 
    Encrypting the connection string applies security against malicious attacker who may hack 
    their way into the configuration file and retrieve the database's user name and password. 
    The textbox below displays the web.config file's content so you can have visual confirmation 
    of the action taken. Simply click the appropriate button and you are done. 
    </div>
    
    <%-- div to wrap form content and align to left by default --%>
    <div>
    
    <%-- ajax update panel start --%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
    <%-- text box to display web.config file --%>
    <asp:TextBox ID="WebConfigContents" runat="server" Rows="15" TextMode="MultiLine" Width="99%" ReadOnly="True">
    </asp:TextBox>
    
    <%-- encrypt/decrypt buttons --%>
    <asp:Button ID="Button1" runat="server" Text="Encrypt Connection String" OnClick="Button1_Click" />
    <asp:Button ID="Button2" runat="server" Text="Decrypt Connection String" OnClick="Button2_Click" />
    
    <br />
    <br />
    
    <%-- label to displays message after encryption and decryption --%>
    <asp:Label ID="alertMessage" runat="server" Text=""></asp:Label>
    
    <%-- ajax update panel end --%>
    </ContentTemplate>
    </asp:UpdatePanel>
    
    </div>

</asp:Content>

